package edu.lingnan.librarymanage.repository;

import edu.lingnan.librarymanage.core.bean.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

/**
 * @author cql
 */
@Repository
public interface UserRepository extends JpaRepository<User, Integer> {


    /**
     * 根据密码和账号查询
     *
     * @param account
     * @param password
     * @return
     */
    User findByAccountAndPassword(String account, String password);

    /**
     * 根据账号或邮箱查找
     *
     * @param account
     * @param email
     * @return
     */
    User findByAccountOrEmail(String account, String email);
}
